#include <bits/stdc++.h>

using namespace std;
using ll = long long;

void solve()
{
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++)
        cin >> v[i];
    sort(v.begin(), v.end());
    v.resize(distance(v.begin(), unique(v.begin(), v.end())));
    n = v.size();
    int ans = 0;
    int x1 = v[0], x2 = v[n - 1];
    while (x1 != x2)
    {
        x1++;
        ans++;
        if (x1 == x2)
            break;
        x2--;
        ans++;
        if (x1 == x2)
            break;
    }
    cout << ans << ' ' << x1;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    while (t--)
    {
        solve();
    }
    return 0;
}